package com.example.server.service.impl;

import com.example.server.pojo.Manager;
import com.example.server.mapper.ManagerMapper;
import com.example.server.service.ManagerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
@Slf4j
@Service
public class ManagerServiceImpl implements ManagerService {
    @Resource
    ManagerMapper managerMapper;
    @Override
    public String login(String id, String passwd) {
        Manager manager = managerMapper.login(id,passwd);
        if(manager !=null)
        {
            if(passwd.equals(manager.getUser_passwd()))return "登录成功";
            else return "密码错误";
        }else{
            return "不存在当前用户";
        }
    }
    @Override
    public String sign(String id, String passwd) {
        managerMapper.sign(id,passwd);
        return "注册成功";
    }
}
